package com.example.account.controller;

import com.alibaba.fastjson.JSONObject;
import com.example.account.service.AccountService;
import com.example.commons.filter.RequestFilter;
import com.example.commons.response.ResponseResult;
import com.example.commons.response.ResultCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/account")
public class AccountController {
    @Autowired
    AccountService accountService;

    @GetMapping("/bal")
    public ResponseResult getUserBal(RequestFilter request) {
        JSONObject req = request.getRequestBodyJson();
        return new ResponseResult(ResultCode.SUCCESS, null, accountService.selectUserAccount(request.getLoginData().getId()));
    }
}
